package com.example.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
@RefreshScope
public class DemoController {

    @Value("${test.name}")
    private String name;

    @Value("${test.name2}")
    private String name2;

    @RequestMapping("/name")
    public String getName() {
        return this.name;
    }

    @RequestMapping("/name2")
    public String getName2() {
        return this.name2;
    }
}